<?
if(!ANTIHACK) die("ANTIHACK...");
include_once(INCLUDES."buildlink.php");
include_once(INCLUDES."paging.php");
$table="video";

$where="";
$total=0;$start=0;$limit=20;
$listpage= paging($table,$where,$_GET,$total,$start,$limit,5);
//lay danh sach bai post
$q=query("select * from $table order by time desc limit $start,$limit");
while($r=fetch($q))
{
	$r["time"]= date("H:i m/m/Y",$r["time"]);
	$code=explode("?v=",$r["link"]);
	$code=$code[1];
	$code=explode("&",$code);
	$code=$code[0];
	$r["code"]=$code;
	$r["thumb"]="http://i3.ytimg.com/vi/$code/0.jpg";
	$data[]=$r;
}
$smarty->assign("listpage",$listpage);
$smarty->assign("total",$total);
$smarty->assign("curpage",$_GET["page"]);
$smarty->assign("data",$data);
$smarty->display("video.htm");
?>